package cn.fuxi2022.core.model.vo.auth;

import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
/**
 * 登录使用
 */
@Data
public class AppletsLoginRegisterVo {

    /**
     * 手机号
     */
    @NotNull(message = "手机号码不能为空", groups = {LoginVoCheck.class, CaptchaVoCheck.class})
    @Pattern(regexp =
            "^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(166)|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9]))\\d{8}$",
            message = "手机号码范围不正确",
            groups = {LoginVoCheck.class, CaptchaVoCheck.class}
    )
    private String phone;

    /**
     * 注册时，发送的验证码
     */
    @NotNull(message = "验证码不能为空", groups = {LoginVoCheck.class})
    @Pattern(regexp = "^\\d{6}$", message = "验证码不合法", groups = {LoginVoCheck.class})
    private String captcha;

    /**
     * 登录时要校验的项目
     */
    public interface LoginVoCheck {
    }

    /**
     * 获取验证码要校验的项目
     */
    public interface CaptchaVoCheck {
    }
}